import { getClassNames, Icon } from "magic-ui-react"
import { FC, ReactNode } from "react"
import styles from './styles.module.less'
import { ContentMenuDefaultItemPropsType } from "./types"


/**
 * 右键默认按钮
 * @param props ContentMenuDefaultItemPropsType
 * @returns 
 */
const ContentMenuDefaultItem: FC<ContentMenuDefaultItemPropsType> = (props) => {
  const {
    icon = 'gear',
    label = 'label',
    children,
    onClick,
    className,
    iconStatus,
    ...rest
  } = props

  return (
    <div
      onClick={(e) => {
        e.stopPropagation()
        onClick?.(e)
      }}
      className={getClassNames([
        styles.ContentMenuDefaultItem,
        className,
      ])}
      {...rest}
    >
      <Icon icon={icon} status={iconStatus} />
      <span>{children || label}</span>
    </div>
  )
}
export default ContentMenuDefaultItem